<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="JavaScript" src="scripts/ts_picker.js"></script>
<title>View All Leave</title>
<fmt:setBundle basename="messages" />
</head>
<body>
<div style="height: 119px; margin-left: 1px">
        <h1 style="text-align: center">
            Leave Application</h1><div id="sidebar1" style="width: 199px; height: 266px">
	<h2>Menu</h2>
	
	<p><a href="LeaveApplyJSP.jsp">Apply Leave</a></p>
	<p style="width: 202px; "><a href="PersonalLeaveHistory.jsp">View Personal Leave History</a></p>
	<p><a href="PersonalLeaveUpdate.jsp">Edit Leave(s)</a></p>
	
	<p><a href="LogoutServlet.jsp">Logout</a></p>
  	<!-- end #sidebar1 --></div>
        </div>
        <div style="margin-left: 248px; height: 379px; width: 496px;"><div>

	<table border=2>
		<tr>
			<td>LeaveType</td>
			<td>Employee ID</td>
			<td>Employee FirstName</td>
			<td>Employee SurName</td>
			<td>Start Date</td>
			<td>End Date</td>
			<td>Leave Detail</td>
		</tr>
		<tr>
			<%-- 		<th><fmt:message key="leaves.LeaveTypeID"/></th>
                <th><fmt:message key="leaves.EmployeeID"/></th>
                <th><fmt:message key="leaves.StartDate"/></th>
                <th><fmt:message key="leaves.EndDate"/></th>
         --%>

			<c:forEach var="leave" items="${leaves}" varStatus="idx">
				<tr>
					<td>${idx.index+1 }</td>
					<td>${leave.employeeID}</td>
					<td>${leave.firstName}</td>
					<td>${leave.surName}</td>
					<td>${leave.StartDate}</td>
					<td>${leave.EndDate}</td>
					<td></td>
					<td><c:url var="detailurl" scope="page"
							value="/ApproveRejectLeave.jsp">
							<c:param name="LeaveTypeID" value="${leaves.LeaveTypeID}" />
							<c:param name="EmployeeID" value="${leaves.EmployeeID}" />
							<c:param name="First Name" value="${leaves.FirstName}" />
							<c:param name="First Name" value="${leaves.SurName}" />
							<c:param name="StartDate" value="${leaves.StartDate}" />
							<c:param name="EndDate" value="${leaves.EndDate}" />

						</c:url> <a href="${detailurl}">Leave detail</a> <c:url var="url"
							scope="page" value="/ApproveRejectLeave.jsp">
						</c:url> <br />
					<br />
				</tr>
			</c:forEach>
	</table>
	</div></div>
</body>
</html>